package com.jack.xiaoer.validator.custom;

import com.jack.xiaoer.constant.LoginTypeEnum;
import com.jack.xiaoer.validator.annotation.LoginType;

import javax.validation.ConstraintValidator;
import javax.validation.ConstraintValidatorContext;

/**
 * Created by Jackaroo Zhang on 2018/12/6.
 */

public class LoginTypeValidator implements ConstraintValidator<LoginType, LoginTypeEnum> {


    @Override
    public void initialize(LoginType constraintAnnotation) {

    }

    @Override
    public boolean isValid(LoginTypeEnum loginType, ConstraintValidatorContext constraintValidatorContext) {
        if (loginType == null) {
            return false;
        }
        return true;
    }

}
